A variety of (non-code) changes that teach docbook generation more about
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 28 Jan 2014 05:38:31 +0000 (05:38 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 28 Jan 2014 05:38:31 +0000 (05:38 +0000)
Smarty and less about DreamWeaver.  Adobe is dead to me.

git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4724 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/Makefile.in
gpsbabel/tools/fixdoc [new file with mode: 0755]
gpsbabel/xmldoc/babelmain.xsl

index a94e572835ffc4ca258ee4a56508a2e35380eee8..f88145306ab300835cb6d96d4e5e495ce87b757d 100644 (file)
@@ -229,6 +229,7 @@ $(WEB)/htmldoc-$(DOCVERSION)/index.html: FORCE
         --stringparam root.filename "index" \
         xmldoc/babelmain.xsl \
         xmldoc/readme.xml
+       tools/fixdoc $(WEB)/htmldoc-$(DOCVERSION) "GPSBabel $(DOCVERSION):"
        chmod 755 tools/mkcapabilities
        tools/mkcapabilities
 
@@ -263,6 +264,10 @@ gpsbabel.html: FORCE # gpsbabel
        xsltproc \
          --output $@ \
          --stringparam toc.section.depth "1" \
+         --stringparam html.cleanup "1" \
+         --stringparam make.clean.html "1" \
+         --stringparam html.valid.html "1" \
+         --stringparam html.stylesheet \
          --stringparam html.stylesheet \
          "http://www.gpsbabel.org/style3.css" \
          http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \
diff --git a/gpsbabel/tools/fixdoc b/gpsbabel/tools/fixdoc
new file mode 100755 (executable)
index 0000000..9bd404e
--- /dev/null
@@ -0,0 +1,39 @@
+#/bin/sh
+
+# set -e
+
+# for the customizations that I'm tired of fighting babelmain.xsl to get
+# docbook to produce HTML that plays nice with Smarty.  
+# This tries to codify a bunch of manual and automated fixes that were needed
+# before to bludgeon our docbook output into Dreamweaver's terrible templating
+# system.
+
+DIR=$1
+TITLE=$2
+
+SED=sed
+[ -f /opt/local/bin/gsed ] && SED=/opt/local/bin/gsed
+
+[ ! -d $DIR/tpl ] && mkdir -p $DIR/tpl
+
+
+for f in $DIR/*.html
+do
+  base=$(echo $f | sed "s/.html$//")
+  $SED -i \
+  -e '/^<?xml/d' \
+  -e '/^<!DOCTYPE head/d' \
+  -e "s#<title>#{block name=title}${TITLE}#" \
+  -e 's#<\/title>.*#{/block}#' \
+  -e '/^<head/d' \
+  -e 's#style="clear: both"##' \
+  $f
+  mv ${base}.html $(dirname $base)/tpl/$(basename $f .html).tpl
+  cat > ${base}.html  << EOF
+<?php
+require("../lib/smarty_common.php");
+\$smarty->display(\$template);
+?>
+EOF
+
+done
index 132c2f9e0d00a6a907d0c0e8079f641216d80095..f70dd825599e3891088af49309011355e9db70e1 100644 (file)
@@ -13,9 +13,6 @@
 <xsl:template name="system.head.content">
   <xsl:text>
   </xsl:text>
-  <xsl:comment> InstanceBegin template="/Templates/primarypage.dwt" codeOutsideHTMLisLocked="false" </xsl:comment>
-  <xsl:text>
-  </xsl:text>
 </xsl:template>
 
 <!--
 <xsl:template name="user.header.navigation">
   <xsl:text> 
   </xsl:text>
-  <xsl:comment> InstanceBeginEditable name="scontent" </xsl:comment> 
 </xsl:template>
 
 <xsl:template name="user.footer.navigation">
   <xsl:text>
   </xsl:text>
-  <xsl:comment> InstanceEndEditable </xsl:comment>
-  <xsl:text>
-  </xsl:text>
-  <xsl:comment> InstanceEnd </xsl:comment>
-  <xsl:text>
-  </xsl:text>
 </xsl:template>
+
+
+<xsl:template name="chunk-element-content" priority="100">
+  <xsl:param name="prev"/>
+  <xsl:param name="next"/>
+  <xsl:param name="nav.context"/>
+  <xsl:param name="content">
+    <xsl:apply-imports/>
+  </xsl:param>
+
+  {extends file="main.tpl"}
+    <xsl:call-template name="html.head">
+      <xsl:with-param name="prev" select="$prev"/>
+      <xsl:with-param name="next" select="$next"/>
+    </xsl:call-template>
+      <xsl:call-template name="body.attributes"/>
+  {block name=body}
+                      <xsl:call-template name="user.header.navigation"/>
+               
+                      <xsl:call-template name="header.navigation">
+                        <xsl:with-param name="prev" select="$prev"/>
+                        <xsl:with-param name="next" select="$next"/>
+                        <xsl:with-param name="nav.context" select="$nav.context"/>
+                      </xsl:call-template>
+               
+                      <xsl:call-template name="user.header.content"/>
+               
+                      <xsl:copy-of select="$content"/>
+               
+                      <xsl:call-template name="user.footer.content"/>
+               
+                      <xsl:call-template name="footer.navigation">
+                        <xsl:with-param name="prev" select="$prev"/>
+                        <xsl:with-param name="next" select="$next"/>
+                        <xsl:with-param name="nav.context" select="$nav.context"/>
+                      </xsl:call-template>
+               
+                      <xsl:call-template name="user.footer.navigation"/>
+      {/block}
+  <xsl:value-of select="$chunk.append"/>
+</xsl:template>
+
  
 </xsl:stylesheet>